/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * MainFrame.java
 *
 * Created on 05-Mar-2010, 15:20:03
 */

package phd.dupenois.changeidentifiers.algorithms.convexhull.frames;

import java.awt.Component;
import java.awt.Dimension;
import java.awt.Point;
import phd.dupenois.changeidentifiers.dotpatterns.DotPattern;
import uk.co.dupenois.geometry.Coordinate;

/**
 *
 * @author mpd209
 */
public class MainFrame extends javax.swing.JFrame implements GridListener{
    private Grid grid;
    /** Creates new form MainFrame */
    public MainFrame() {
        initComponents();
        Dimension dimension = new Dimension(800, 600);
        setSize(this, dimension);
        grid = new Grid(this, this, 5);
        this.add(grid);
    }
    public void setDotPattern(DotPattern pattern){
        grid.setDotPattern(pattern);
    }
    public void setDotBeingAdded(Coordinate coord){
        grid.setDotBeingAdded(coord);
    }
    public void setRightAngleCheck(Coordinate last,Coordinate last_1,Coordinate last_2){
        grid.setRightAngleCheck(last, last_1, last_2);
    }
    public void setCurrentUpperHull(Coordinate[] upper){
        grid.setCurrentUpperHull(upper);
    }
    public void setCurrentLowerHull(Coordinate[] lower){
        grid.setCurrentLowerHull(lower);
    }
    private void setSize(Component component, Dimension dimension){
        component.setSize(dimension);
        component.setPreferredSize(dimension);
        component.setMaximumSize(dimension);
        component.setMinimumSize(dimension);
    }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        getContentPane().setLayout(new java.awt.GridLayout());

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
    * @param args the command line arguments
    */
        public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new MainFrame().setVisible(true);
            }
        });
    }

    public void updateLocation(int x, int y) {
    }

    public void setStatus(String status) {
    }

    public Point[] getPoints(int index) {
        return new Point[0];
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables

}
